#include "PowerFlowCalculation.h"

void ModifyNodeValue(Node* m_Node,gsl_matrix* m_G,gsl_matrix* m_B,int Node_Num)
{
    for(int i=0;i<Node_Num;i++){
        m_Node[i].P=0;
        m_Node[i].Q=0;
        for(int j=0;j<Node_Num;j++){
            double f= m_Node[i].Angle - m_Node[j].Angle;
            m_Node[i].P+=m_Node[i].Vol*m_Node[j].Vol*(gsl_matrix_get(m_G,i,j)*cos(f)+gsl_matrix_get(m_B,i,j)*sin(f));
            m_Node[i].Q+=m_Node[i].Vol*m_Node[j].Vol*(gsl_matrix_get(m_G,i,j)*cos(f)-gsl_matrix_get(m_B,i,j)*cos(f));
        }
    }


}

